package com.geek.sort;

import org.apache.zookeeper.server.admin.JsonOutputter;

/**
 * 冒泡排序
 */
public class BubbleSort {

	public static void main(String[] args) {
		int[] arr = new int[]{10,5,3,2,4,8,6};

		for (int i = 0; i <arr.length; i++) {
			for (int j = i+1; j <arr.length; j++) {
				if(arr[i] > arr[j]){
					int temp = arr[i];
					arr[i] = arr[j];
					arr[j] = temp;
				}
			}
		}

		for (int j : arr) {
			System.out.print(j+",");
		}
	}

}
